<%@ Page Language="C#" MasterPageFile="~/MasterPages/manager/manager.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="manager_members_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2>Users</h2>
    <asp:Button ID="btnAddUser" runat="server" Text="Add a User" UseSubmitBehavior="False" OnClientClick='document.location.href="AddEditUser.aspx";return false;' /><br />
    <br />
    <asp:GridView ID="gvMembers" runat="server" AllowSorting="True" AutoGenerateColumns="False"
        DataKeyNames="UserName" DataSourceID="odsMembers" EmptyDataText="There are no user accounts to view"
        RowHeaderColumn="UserName" Width="100%" OnRowDataBound="gvMembers_RowDataBound">
        <Columns>
            <asp:BoundField DataField="Firstname" HeaderText="First Name" SortExpression="Firstname" />
            <asp:BoundField DataField="Surname" HeaderText="Surname" SortExpression="Surname" />
            <asp:BoundField DataField="UserName" HeaderText="Username" ReadOnly="True" SortExpression="UserName" />
            <asp:TemplateField HeaderText="Website" SortExpression="WebsiteID">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("WebsiteID") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblWebsite" runat="server" Text='<%# Bind("WebsiteID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="CreationDate" HeaderText="Date Created" ReadOnly="True"
                SortExpression="CreationDate" />
            <asp:BoundField DataField="LastActivityDate" HeaderText="Last Activity" SortExpression="LastActivityDate" />
            <asp:HyperLinkField DataNavigateUrlFields="UserName" DataNavigateUrlFormatString="AddEditUser.aspx?username={0}"
                Text="Edit" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="odsMembers" runat="server" DeleteMethod="Delete" InsertMethod="Insert"
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetMembers" SortParameterName="SortData"
        TypeName="MembershipUtilities.MembershipUserAndProfileODS" UpdateMethod="Update" OnSelecting="odsMembers_Selecting">
        <DeleteParameters>
            <asp:Parameter Name="UserName" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="userName" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="isLockedOut" Type="Boolean" />
            <asp:Parameter Name="isApproved" Type="Boolean" />
            <asp:Parameter Name="comment" Type="String" />
            <asp:Parameter Name="lastActivityDate" Type="DateTime" />
            <asp:Parameter Name="lastLoginDate" Type="DateTime" />
            <asp:Parameter Name="firstname" Type="String" />
            <asp:Parameter Name="surname" Type="String" />
            <asp:Parameter Name="customerID" Type="Int32" />
            <asp:Parameter Name="websiteID" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ProfileParameter Name="WebsiteID" PropertyName="WebsiteID" Type="Int32" />
            <asp:Parameter DefaultValue="manager,guest" Name="rolesToInclude" Type="String" />
            <asp:Parameter Name="SortData" Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="userName" Type="String" />
            <asp:Parameter Name="isApproved" Type="Boolean" />
            <asp:Parameter Name="comment" Type="String" />
            <asp:Parameter Name="lastLockoutDate" Type="DateTime" />
            <asp:Parameter Name="creationDate" Type="DateTime" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="lastActivityDate" Type="DateTime" />
            <asp:Parameter Name="providerName" Type="String" />
            <asp:Parameter Name="isLockedOut" Type="Boolean" />
            <asp:Parameter Name="lastLoginDate" Type="DateTime" />
            <asp:Parameter Name="isOnline" Type="Boolean" />
            <asp:Parameter Name="passwordQuestion" Type="String" />
            <asp:Parameter Name="lastPasswordChangedDate" Type="DateTime" />
            <asp:Parameter Name="password" Type="String" />
            <asp:Parameter Name="passwordAnswer" Type="String" />
            <asp:Parameter Name="firstname" Type="String" />
            <asp:Parameter Name="surname" Type="String" />
            <asp:Parameter Name="customerID" Type="Int32" />
            <asp:Parameter Name="websiteID" Type="Int32" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>

